package me.xiaolei.andlog.thread_pool

import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.atomic.AtomicInteger

// 自定义线程池
object LogThreadPool
{
    // 线程ID
    private val thread_Id = AtomicInteger(0)
    
    // 线程池
    val pool: ExecutorService = Executors.newSingleThreadExecutor { runnable ->
        Thread(runnable).apply {
            isDaemon = true
            name = "LogThread-${thread_Id.getAndAdd(1)}"
        }
    }
}